package main

import "fmt"

func main() {
	min, max := 0, 100
	fmt.Printf("define a number between %d~%d\n", min, max)
	for min < max {
		i := (min + max) / 2
		fmt.Printf("this number less than or equal %d?(y/n)", i)
		var s string
		fmt.Scanf("%s", &s)
		if s != "" && s[0] == 'y' {
			max = i
		} else {
			min = i + 1
		}
	}
	fmt.Printf("this number is %d\n", max)
}
